<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<script type="text/javascript">
	var maxPage = 6;
	var httpHost = "http://172.24.29.89:8080/yncu";
	var folder = "picfolder/";
	var filePath = "20111213014236131518070/";
	var fileExit = ".jpg";
	function setImage(page) {
		var imagePath = httpHost + "/" + folder + filePath + page + fileExit;
		document.getElementById("currentPage").value = page;
		document.getElementById("pageNum").innerHTML = (page + 1);
		document.getElementById("pageNum1").innerHTML = (page + 1);
		document.getElementById("showImage").src = imagePath;
		loadPic(imagePath);
	}
	function prePage() {
		var currentPage;
		currentPage = parseInt(document.getElementById("currentPage").value);
		if (currentPage > 0) {
			currentPage -= 1;
			setImage(currentPage);
		}
	}
	function nextPage() {
		var currentPage;
		currentPage = parseInt(document.getElementById("currentPage").value);
		if (currentPage < maxPage - 1) {
			currentPage += 1;
			setImage(currentPage);
		}
	}
	function loadPic(url) {
		var img = new Image();
		document.getElementById("imageHtml").style.display = "none";
		document.getElementById("loading").style.display = "block";
		img.onload = function() {
			document.getElementById("loading").style.display = "none";
			document.getElementById("imageHtml").style.display = "block";
		}
		img.onerror = function() {
			document.getElementById("loading").style.display = "none";
			document.getElementById("loadError").style.display = "block";
		}
		img.src = url;
	}
	window.onload = function() {
		loadPic(httpHost + "/" + folder + "/" + filePath + "0.jpg");
	}
</script>
	</head>
	<body style="padding: 5px; margin: 0px; text-align: center">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td align="center">
					<input name="hisBtn" type="button" value="返回"
						onclick="javascript:history.go(-1);"
						style="width: 90px; height: 70px; font-size: 24px; font-weight: bold;" />
					&nbsp;&nbsp;
					<input type="button" value="上一页" onclick="prePage()"
						style="width: 120px; height: 70px; font-size: 24px; font-weight: bold;" />
					&nbsp;&nbsp;
					<input type="button" onclick="nextPage()" value="下一页"
						style="width: 120px; height: 70px; font-size: 24px; font-weight: bold;" />
					&nbsp;&nbsp;
					<span style="font-size: 24px; font-weight: bold"><span
						id="pageNum">1</span>/6页</span>
				</td>
			</tr>
			<tr id="loading" style="text-align: center;">
				<td width="480">
					<img src="http://172.24.29.89:8080/yncu/loading.gif" />
					<br />
					图片加载中...
				</td>
			</tr>
			<tr id="loadError" style="display: none; text-align: center">
				<td width="100%">
					图片加载出误，请与管理员联系!
				</td>
			</tr>
			<tr id="imageHtml" style="display: none; text-align: center">
				<td>
					<input type="hidden" id="fileName"
						value="E:\Work\YnCuService\WebRoot\downloadpath/20111213014236131518070.pdf" />
					<input type="hidden" id="currentPage" value="0">
					<input type="hidden" id="fileSize" value="156582" />
					<input type="hidden" id="picNum" value="6" />
					<img src="20111213014236131518070/0.jpg" id="showImage" width="700">
				</td>
			</tr>
			<tr>
				<td>
					<input name="hisBtn" type="button" value="返回"
						onclick="javascript:history.go(-1);"
						style="width: 90px; height: 70px; font-size: 24px; font-weight: bold;" />
					&nbsp;&nbsp;
					<input type="button" value="上一页" onclick="prePage()"
						style="width: 120px; height: 70px; font-size: 24px; font-weight: bold;" />
					&nbsp;&nbsp;
					<input type="button" onclick="nextPage()" value="下一页"
						style="width: 120px; height: 70px; font-size: 24px; font-weight: bold;" />
					&nbsp;&nbsp;
					<span style="font-size: 24px; font-weight: bold"><span
						id="pageNum1">1</span>/6页</span>
				</td>
			</tr>
		</table>
	</body>
</html>